import request from "@/utils/request";

// 图书分页查询
export function page(pageNum, pageSize, params)  {
    const data = {
        pageNum,
        pageSize,
        params
    }
    return request({
        url: "/shopCar/page/",
        method: 'post',
        data: data
    })
}

// 添加购物车
export function addShopCar(userId, bookId, bookName, bookPrice, count, bookImage) {
    const data = {
        userId, bookId, bookName, bookPrice, count, bookImage
    }
    return request({
        url: "/shopCar/add/",
        method: 'post',
        data: data
    })
}

// 查询购物车总量
export function carCount(userId) {
    return request({
        url: "/shopCar/count/",
        method: 'post',
        data: userId
    })
}

// 购物车数据 + 1
export function carShopAddOne(car) {
    return request({
        url: "/shopCar/add/",
        method: 'post',
        data: car
    })
}

// 购物车数据 - 1
export function carShopReduceOne(car) {
    return request({
        url: "/shopCar/remove/",
        method: 'post',
        data: car
    })
}


// 购物车数据移除
export function carRemove(car) {
    return request({
        url: "/shopCar/removeAll/",
        method: 'post',
        data: car
    })
}
